package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.CourseCategoryTreeDTO;
import com.xuecheng.content.service.CourseCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 课程分类相关接口
 *
 * @author jiang zhongxun
 * @create 2023-03-08 22:21
 */
@RestController
public class CourseCategoryController {

    @Autowired
    CourseCategoryService courseCategoryService;

    /**
     * 查询课程分类的树形节点
     *
     * @return {@link List}<{@link CourseCategoryTreeDTO}>
     */
    @GetMapping("/course-category/tree-nodes")
    public List<CourseCategoryTreeDTO> queryTreeNodes() {
        return courseCategoryService.queryTreeNodes();
    }

}
